home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / wtj008.zip / OBJECTS.ZIP / TESTSPAS.PAS < prev    next >
Pascal/Delphi Source File  |  1992-05-17  |  611b  |  26 lines

  1. program TestStrings;
  2. uses WinTypes, UStrings, WinCrt;
  3.  
  4. var
  5.   String1, String2 : TString;
  6.  
  7. begin
  8.   {instantiate the TStrings}
  9.   if not TStringInit('This is string one', String1) then begin
  10.     WriteLn('Unable to instantiate String1');
  11.     Halt;
  12.   end;
  13.   if not TStringInit('This is string two', String2) then begin
  14.     WriteLn('Unable to instantiate String2');
  15.     Halt;
  16.   end;
  17.  
  18.   {call the sGetString "method"}
  19.   WriteLn(String1.sGetString(@String1));
  20.   WriteLn(String2.sGetString(@String2));
  21.  
  22.   {call the sDone "destructor"}
  23.   String2.sDone(@String2);
  24.   String1.sDone(@String1);
  25. end.
  26.